--
-- Author:      feilong
-- DateTime:    2019-10-30 10:59:15
-- Description: 节点中用户管理


local UserManager = class("UserManager")

function UserManager:ctor()
    self.user_list = {}
end

function UserManager:start()

end

function UserManager:addUser(user)
    local user_id = user:getUserId()
    local old_user = self.user_list[user_id]
    self.user_list[user_id] = user
    return old_user
end

function UserManager:removeUser(user_id)
    if not self.user_list[user_id] then 
        return false
    end
    self.user_list[user_id] = nil
end

function UserManager:getUser(user_id)
    return self.user_list[user_id]
end

function UserManager:getUserList()
    return self.user_list
end






















return UserManager